<meta charset="utf-8">
<div class="box box-primary" id="pmpRequires_addRoot" >
	<form role="form" id="pmpRequires_addRoot_editForm" >
		<div class="box-body">
			<div class="form-group">
				<label></label>
					<input type="text" name="name" v-model="pmpRequires.name" class="form-control" id="name" required />
			</div>
			<div class="box-footer">
				<button type="button" class="btn btn-default" v-on:click="cancle">取消</button>
				<button type="button" class="btn btn-info pull-right" v-on:click="add">提交</button>
			</div>
	</div>
</form>
<script type="text/javascript">
new Vue({el : '#pmpRequires_addRoot',
		 data : {
			 pmpRequires : {
					projectId : null,
					name : null
			},
			bus : new Vue(),
		},
	    mounted : function() {
				var _this=this;
					 var param=zfesLayerEditDg.getLayerParam();//projectId  
					_this.pmpRequires.projectId=param.projectId;
		},
		methods : {
				add : function() {
					if ($("#pmpRequires_addRoot_editForm").valid()) {
						let _this = this;
						let url = "/pmp/service/pm/pmpRequires/createRoot";
						zfesAjax.ajaxTodo(url,_this.$data.pmpRequires,function(data) {
							alertSwal.successText(data.message);
									layer.close(layer.index);
							})
						}
				},
				cancle : function() {
					layer.close(layer.index);
				}
		}
});
	</script>
</div>
